package com.wnhz.work.jy.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.RecyclerView.ViewHolder;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.wnhz.work.jy.R;

import org.xutils.x;

import java.util.List;

public class MapRecyclerViewAdapter extends RecyclerView.Adapter<ViewHolder> {

	private Context context;
	private List<String> mList;
	private OnClickListener listener;
	private DisplayImageOptions imageOptions;

	public void setImageOptions(DisplayImageOptions imageOptions) {
		this.imageOptions = imageOptions;
	}

	public MapRecyclerViewAdapter(Context context, List<String> mList, OnClickListener listener) {
		super();
		this.context = context;
		this.mList = mList;
		this.listener = listener;
	}

	@Override
	public int getItemCount() {
		// TODO Auto-generated method stub
		return mList.size();
	}

	@Override
	public void onBindViewHolder(ViewHolder arg0, int arg1) {
		// TODO Auto-generated method stub
		MyHolder holder = (MyHolder) arg0;
		x.image().bind(holder.imageView,mList.get(arg1));
	}

	@Override
	public ViewHolder onCreateViewHolder(ViewGroup arg0, int arg1) {
		View view = LayoutInflater.from(context).inflate(R.layout.item_map_recycler, null);
		MyHolder holder = new MyHolder(view);
		return holder;
	}

	private class MyHolder extends ViewHolder {
		private ImageView imageView;

		public MyHolder(View arg0) {
			super(arg0);
			imageView = (ImageView) arg0.findViewById(R.id.img);
		}

	}

}
